package com.neuedu.date;

import java.util.Calendar;
import java.util.Date;

public class DateExample {
	public static void main(String[] args) {
		//如何把字符串转换为日期
		Date date=new Date();
		System.out.println(date);
		Calendar calendar=Calendar.getInstance();
		calendar.setTime(date);
		System.out.println(calendar.get(Calendar.YEAR));
	}

}
